package com.ixuea.courses.mycloudmusicapisp.util;

/**
 * 全局常量类
 */
public class Constant {

    //发送验证码平台

    /**
     * 邮件
     */
    public static final Integer PLATFORM_EMAIL = 0;

    /**
     * 手机号
     */
    public static final Integer PLATFORM_PHONE = 10;

    /**
     * QQ
     */
    public static final Integer PLATFORM_QQ = 20;

    /**
     * 微信
     */
    public static final Integer PLATFORM_WECHAT =30;

    /**
     * 微博
     */
    public static final Integer PLATFORM_WEIBO = 40;



    //全局错误码

    /**
     * 未知错误
     */
    public static final int ERROR_UNKNOWN = 20;
    public static final String ERROR_UNKNOWN_MESSAGE = "未知错误，请稍后再试！";

    /**
     * 参数错误
     */
    public static final int ERROR_ARGUMENT = 30;
    public static final String ERROR_ARGUMENT_MESSAGE = "参数错误！";


    /**
     * 资源不存在错误
     */
    public static final int ERROR_NOT_FOUND = 40;
    public static final String ERROR_NOT_FOUND_MESSAGE = "资源不存在";

    /**
     * 加盐格式化字符串
     */
    public static final String FORMAT_SALT = "1231233%srtertvczxvx";

    /**
     * 数据已经存在错误
     */
    public static final int ERROR_DATA_EXIST = 1550;
    public static final String ERROR_DATA_EXIST_MESSAGE = "数据已经存在！";

    //业务错误码

    /**
     * 已经注册了错误
     */
    public static final int ERROR_USER_EXIST = 1000;
    public static final String ERROR_USER_EXIST_MESSAGE = "用户已经存在了";

    /**
     * 保存数据失败错误
     */
    public static final int ERROR_SAVE_DATA = 1540;
    public static final String ERROR_SAVE_DATA_MESSAGE = "保存数据失败，请稍后再试！";

    /**
     * 数据库操作成功，返回1
     */
    public static final int RESULT_OK = 1;

    /**
     * 用户不存在错误
     */
    public static final int ERROR_USR_NOT_EXIST = 1010;
    public static final String ERROR_USR_NOT_EXIST_MESSAGE = "用户不存在";

    /**
     * 用户名和密码错误
     */
    public static final int ERROR_USERNAME_OR_PASSWORD = 1030;
    public static final String ERROR_USERNAME_OR_PASSWORD_MESSAGE = "用户名或密码错误！";

    /**
     * 用户id header名称
     */
    public static final String USER = "USER";

    /**
     * 用户token header名称
     */
    public static final String AUTHORIZATION = "Authorization";

    /**
     * request当前用户key
     */
    public static final String CURRENT_USER = "currentUser";

}
